﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace MvcApplication.Sale.Service
{
    public class ServiceBiz
    {
        public static Dictionary<Type, Type> GetAllInterface()
        {
            var assembly = Assembly.GetExecutingAssembly();
            var allTypes = assembly.GetTypes();

            var result = new Dictionary<Type, Type>();

            allTypes.ToList().ForEach(type =>
            {
                var interfaces = type.GetInterfaces();

                interfaces.ToList().ForEach(i =>
                {
                    if (i.FullName.Contains("MvcApplication.Interface"))
                    {
                        result.Add(type, i);
                    }
                });
            });

            return result;
        }
    }
}
